package com.itheima.exam.Exam7;

import com.itheima.day05.zuoye.ZuoYe2.New;

import java.io.*;

public class Copy {
    public static void copy(File a, File b) throws Exception {

        FileInputStream fis = new FileInputStream(a);
        FileOutputStream fos = new FileOutputStream(b);
        BufferedInputStream bis = new BufferedInputStream(fis);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        byte[] bs = new byte[1024];
        int len;
        while ((len = bis.read(bs)) != -1) {
            bos.write(bs, 0, len);
        }
        bos.close();
        bis.close();
        System.out.println("复制完毕");

    }


}
